.ant-btn-icon-only {
  width: 2rem !important;
  min-width: 2rem !important;
  height: 2rem !important;
  min-height: 2rem !important;
}

.ant-btn {
  border-radius: 0.25rem;

  &:hover,
  &:active,
  &:focus {
    color: #00796a;
    border-color: #00796a;
  }
}

// 带有边框的按钮样式 类名ghost
.ant-btn.ghost {
  color: #00796a;
  border-color: #00796a;

  &:hover,
  &:active,
  &:focus {
    // color: #00796a85;
    // border-color: #00796a85;
  }
}

// ============ 按钮样式 类名cancel ==========
.ant-btn.cancel {
  color: #4e5969;
  border-color: #86909c;

  &:hover,
  &:active,
  &:focus {
    // border-color: #00796a85;
  }
}

// ============ 按钮样式 type='primary' ==========
.ant-btn.ant-btn-primary {
  color: @bg-color;
  background-color: #00796a;
  border-color: transparent;

  &:hover,
  &:active,
  &:focus {
    // color: #00796a85;
    // border-color: #00796a85;
  }
}

// ============ 按钮样式 type='submit' ==========
.ant-btn.ant-btn-submit {
  color: @bg-color;
  background-color: #00796a;
  border: none;
  border-radius: 0.25rem;

  &:hover,
  &:active,
  &:focus {
    background-color: #00796a85;
  }
}

// ============ 按钮样式 type='cancel' ==========
.ant-btn.ant-btn-cancel {
  color: @primary-color;
  background: #d6e5ff;
  border: none;
  border-radius: 0.25rem;

  &:hover,
  &:active,
  &:focus {
    background: #d6e5ff85;
    border-color: #d6e5ff85;
  }
}

// ============ 按钮样式 type='link' ==========
.ant-btn.ant-btn-link {
  padding: 0;
  color: #00796a;
  border: none;

  // &:hover,
  // &:active,
  // &:focus {
  //   color: #00796a85;

  //   > span {
  //     text-decoration: underline;
  //   }
  // }

  &:hover {
    color: #00796a85;

    > span {
      text-decoration: underline;
    }
  }

  &:not(:first-child) {
    margin-left: 0.375rem;
  }
}

// 按钮禁用状态
.ant-btn-link[disabled],
.ant-btn-link[disabled]:hover,
.ant-btn-link[disabled]:focus,
.ant-btn-link[disabled]:active {
  color: #b3b3b3 !important;
}

// ============ 按钮样式 类名sub 小标题 ==========
.ant-btn.sub {
  padding: 0;
  border: none;
  box-shadow: none;
  cursor: default;

  > span {
    font-weight: 700;
    font-size: 0.875rem;
  }

  &:hover,
  &:active,
  &:focus {
    color: #181818;
    box-shadow: none;
  }
}

// ============ 按钮样式 类名delete ==========
.ant-btn.delete span {
  &:hover,
  &:active,
  &:focus {
    color: #ff3030;
  }
}

// .button-link-disabled {
//   color: #b3b3b3 !important;

//   &:hover,
//   &:active,
//   &:focus {
//     color: #b3b3b3 !important;

//     > span {
//       text-decoration: underline;
//     }
//   }
// }

// ============ checkbox ==========
.ant-checkbox-wrapper {
  color: #181818;

  // 设置默认的颜色
  .ant-checkbox {
    // .ant-checkbox-input {}

    .ant-checkbox-inner {
      background-color: transparent;
      border-color: #e5e6eb;
    }
  }

  // 设置选中的颜色
  .ant-checkbox-checked .ant-checkbox-inner,
  .ant-checkbox-indeterminate .ant-checkbox-inner {
    background-color: #00796a;
    border-color: #00796a;
  }

  // 鼠标hover时候的颜色
  .ant-checkbox-wrapper:hover .ant-checkbox-inner,
  .ant-checkbox:hover .ant-checkbox-inner,
  .ant-checkbox-input:focus + .ant-checkbox-inner {
    border-color: #00796a;
  }
}

// ============ ant-checkbox-group ==========
.ant-checkbox-group {
  width: 100%;
}

// ============ radio ==========
.ant-radio-wrapper {
  color: #181818;

  .ant-radio-inner {
    background-color: transparent;
  }

  // 设置选中的颜色
  .ant-radio-checked .ant-radio-inner {
    border-color: #00796a;

    &::after {
      background-color: #00796a;
    }
  }

  // 鼠标hover时候的颜色
  .ant-radio-wrapper:hover .ant-radio,
  .ant-radio:hover .ant-radio-inner,
  .ant-radio-input:focus + .ant-radio-inner {
    border-color: #00796a;
  }
}

// ============ ant-radio-group ==========
.ant-radio-group {
  width: 100%;
}

// ============ a-input ==========
.ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover,
.ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):active {
  border-color: #00796a;
}

.ant-input-affix-wrapper:focus,
.ant-input-affix-wrapper-focused {
  border-color: #00796a;
  box-shadow: 0 0 0 0.125rem rgb(0 121 106 / 30%);
}

// ============ ant-input-number ==========
.ant-input-number:not(.ant-input-number-disabled):hover {
  border-color: #00796a;
}

.ant-input-number:focus,
.ant-input-number-focused {
  border-color: #00796a;
  box-shadow: 0 0 0 0.125rem rgb(0 121 106 / 30%);
}

// ============ a-select ==========
.ant-select:not(.ant-select-disabled):hover .ant-select-selector,
.ant-select:not(.ant-select-disabled):active .ant-select-selector {
  border-color: #00796a;
}

.ant-select-focused:not(.ant-select-disabled).ant-select:not(
    .ant-select-customize-input
  )
  .ant-select-selector {
  border-color: #00796a;
  box-shadow: 0 0 0 0.125rem rgb(0 121 106 / 30%);
}

// 下拉框选中后的颜色
.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
  background-color: #00796a15;
}

// 默认样式
// .ant-select:not(.ant-select-customize-input) .ant-select-selector{
//   background-color: transparent;
// }

// ============ ant-tree ==========
.ant-tree {
  overflow-y: auto;
  background-color: transparent;

  .ant-tree-node-content-wrapper {
    padding-left: 0.5rem;
    min-height: 2rem;
    line-height: 2rem;
  }
}

.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
  text-decoration: none;
  color: #181818;
  background-color: #00796a12;
  border-radius: 0.25rem;
}

// ============ ant-spin ==========
.ant-spin {
  display: flex;
  flex-direction: column;
  align-items: center;

  .ant-spin-dot-item {
    background-color: #00796a !important;
  }

  .ant-spin-text {
    margin-top: 0.375rem;
    color: #00796a !important;
  }
}

// :deep(.ant-spin-nested-loading) {
//   overflow-y: auto !important;
//   height: calc(100% - 5.75rem);
// }

// ============ ant-switch ==========
// 开关
.ant-switch {
  // background-color: red;
}

.ant-switch-checked {
  background-color: #00796a;
}

// ============ ant-table ==========
.ant-table-wrapper {
  .ant-table-thead {
    .ant-table-cell {
      padding-top: 0;
      padding-bottom: 0;
      height: 2.75rem;
      font-size: 0.875rem;
      color: #4e5969;
      background-color: #e5e6eb;
      font-weight: 700;
    }
  }

  .ant-table-tbody {
    > tr.ant-table-row:hover > td {
      > tr > td.ant-table-cell-row-hover {
        background-color: #fafafa;
      }
    }

    > tr.ant-table-row {
      &:nth-child(even) {
        // background-color: #fbfbfb;
      }
    }

    > tr > td.ant-table-cell {
      // &:first-child {} // 序号列

      padding-top: 0;
      padding-bottom: 0;
      height: 2.75rem;
      color: #707479;

      &:empty::after {
        // 内容为空时
        content: '--';
      }
    }

    > tr.ant-table-placeholder {
      // display: none ; // 空时，删除空状态

      > td.ant-table-cell {
        // 空时，删除底部边框
        height: 28rem;
        border-bottom: none;
      }
    }
  }
}

.ant-table {
  // background-color: red;

  thead {
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .table-striped {
    td {
      background: #527ecc0d;
    }
  }
}

.ant-table-thead
  > tr
  > th:not(:last-child):not(.ant-table-selection-column):not(
    .ant-table-row-expand-icon-cell
  ):not([colspan])::before {
  width: 0;
}

.ant-table-container table > thead > tr:first-child th:first-child {
  padding-left: 2.5rem;
}

.ant-table-tbody > tr > td:first-child {
  padding-left: 2.5rem;
}

.ant-table-container table > thead > tr:first-child th:last-child {
  padding-right: 2.5rem;
}

.ant-table-tbody > tr > td:last-child {
  padding-right: calc(2.5rem - 0.25rem);
}

// ============ a-date-picker ==========
.ant-picker-focused {
  border-color: #00796a;
  box-shadow: 0 0 0 0.125rem rgb(0 121 106 / 30%);
}

.ant-picker:hover,
.ant-picker-focused {
  border-color: #00796a;
}

.ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner,
.ant-picker-cell-in-view.ant-picker-cell-range-start .ant-picker-cell-inner,
.ant-picker-cell-in-view.ant-picker-cell-range-end .ant-picker-cell-inner {
  background: #00796a;
}

.ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner::before {
  border: 0.0625rem solid #00796a;
}

.ant-popover-placement-top {
  .ant-popover-inner {
    border-radius: 0.5rem;
  }

  .ant-popover-inner-content {
    padding: 0;

    .item-content {
      width: 18rem;

      &-title {
        font-weight: bold;
        padding: 0.625rem 1.5rem;
      }

      &-body {
        overflow: hidden scroll;
        padding: 0 1.5rem 1rem;
        height: 20rem;
        scrollbar-width: none;
      }

      .common {
        &-item {
          line-height: 2rem;
          padding-left: 0.75rem;
          border-radius: 0.125rem;
          border-left: 0.125rem solid transparent;

          &:hover {
            cursor: pointer;
            background-color: rgb(0 121 106 / 16%);
            border-left: 0.125rem solid #00796a;
          }
        }
      }
    }
  }
}
